#ifndef AST_STATEMENT_BLOCK_ITEM_H
#define AST_STATEMENT_BLOCK_ITEM_H

#include "../ASTNode.h"
class Declaration;
class Statement;

/*
C99   6.8.2
block-item:
		declaration
		statement
*/
class BlockItem : public ASTNode
{
public:
	enum{
		declaration,
		statement,
	};
protected:
	BlockItem(void)
		:ASTNode(ASTNode::block_item){};
public:
	BlockItem(Declaration *pDecl)
		: ASTNode(ASTNode::block_item)
		, m_iType(declaration)
		, m_pDecl(pDecl){};

	BlockItem(Statement *pStmt)
		: ASTNode(ASTNode::block_item)
		, m_iType(statement)
		, m_pStmt(pStmt) {};

	virtual ~BlockItem(void);

	virtual void					codeGen();
protected:
	tiny_int					m_iType;
	union{
		Declaration *			m_pDecl;
		Statement *				m_pStmt;
	};
};


#endif

